
<style>
html,body {
    margin: 0;
    height: 100%;
}
.flex {
    display: flex;
    flex-direction: column;
}
.flex>div:nth-child(1) {
    background-color: green;
    flex: 1;
}
.flex>div:nth-child(2) {
    background-color: yellow;
    height: 300px;
}
</style>
<div class="flex">
    <div></div>
    <div></div>
</div>